Skip to content

Add the non-Pro 2.5.3 media API, account permissions and explicit virtual device state - #70

Merged
chiconws merged 1 commit into
devfrom
media-permissions-2.5.3
Nov 11, 2026
Merged

chiconws merged 1 commit into
devfrom
media-permissions-2.5.3

Conversation

@chiconws

Copy link
Copy Markdown
Collaborator

Follow-up to #69: brings the client up to NanoKVM non-Pro 2.5.3 and 2.5.4 (CHANGELOG).

Virtual media (2.5.3)

  • New MediaController for /storage/media/*: get_media, get_media_state, get_media_status, mount_media, eject_media, delete_media, list_media_files, upload_media_file, download_media_file, delete_media_file, download_media, and create_media_directory (2.5.4).
  • rel names an image. Leaving it out means the shared data partition.
  • A refused download raises the device error and leaves no file behind.
  • The existing image methods are untouched; the firmware keeps those routes as a compatibility layer.

Account permissions (2.5.3)

  • get_permissions() returns the catalog, and there is a new Permission enum.
  • create_user, update_user and delete_user gain permissions= and rotate_mcp_key= (on delete_user, only rotate_mcp_key=).
  • GetAccountRsp.permissions and UserInfo.permissions carry the grants. A null list from the device reads as empty.
  • On older firmware these arguments are refused locally.

Virtual device state (2.5.3)

  • update_virtual_device(enable=...) sets the device on or off instead of toggling it.
  • It is refused on older firmware and on the Pro, which ignore the field and would toggle.

StatusImageRsp gains loaded and total. docs/api.md documents all of the above.

Tests: pytest 529 passed. Pre-commit (ruff, ruff-format, codespell, mypy) passed. Not tested on a live device on 2.5.3 or 2.5.4.

…tual device state

NanoKVM 2.5.3 replaced the image page with a storage API, added
fine-grained account permissions and let a virtual device be set on or
off instead of toggled; 2.5.4 added directory creation.

- MediaController covers /storage/media: list, state, transfer status,
  mount, eject, delete, and listing, upload, download, mkdir (2.5.4) and
  delete of files inside an image or the shared data partition. rel names
  an image; leaving it out addresses the partition. A refused download
  raises the device error and leaves no file behind.
- get_permissions(), Permission, and permissions= / rotate_mcp_key= on
  create_user, update_user and delete_user; GetAccountRsp and UserInfo
  carry the grants. Older firmware refuses the new arguments locally.
- update_virtual_device(enable=) needs non-Pro 2.5.3: older firmware
  ignores the field and toggles, so it is refused there.
- StatusImageRsp gains loaded and total.
@chiconws
chiconws merged commit 930076d into dev Nov 11, 2026
3 checks passed
@chiconws
chiconws deleted the media-permissions-2.5.3 branch November 12, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant